#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
void my_strncpy(const char* name, char* str,int n);
int main()
{
	char name[20] = "abcd";
	char str[20] = "0";
	int n = 3;
	my_strncpy(name, str,n);
	printf("%s", str);
	return 0;
}
void my_strncpy(const char* name, char* str,int n)
{
	for (int i = 0; i < n; i++)
	{
		*(str + i) = *(name + i);
	}
}